.class public Lcom/fiberhome/xloc/broadcast/NetCheckReceiver;
.super Landroid/content/BroadcastReceiver;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 6

    const/4 v5, 0x0

    const/4 v4, 0x1

    const/4 v3, 0x0

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "android.net.conn.CONNECTIVITY_CHANGE"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    invoke-static {p1}, Lcom/fiberhome/gaea/client/c/a;->b(Landroid/content/Context;)Ljava/lang/String;

    const-string/jumbo v0, "connectivity"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/net/ConnectivityManager;

    invoke-virtual {v0, v3}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;

    move-result-object v1

    invoke-virtual {v0, v4}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;

    move-result-object v0

    if-eqz v1, :cond_0

    invoke-virtual {v1}, Landroid/net/NetworkInfo;->isConnected()Z

    move-result v1

    if-nez v1, :cond_1

    :cond_0
    if-eqz v0, :cond_2

    invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z

    move-result v0

    if-eqz v0, :cond_2

    :cond_1
    :try_start_0
    const-string/jumbo v0, "\u7f51\u7edc\u72b6\u6001\u6539\u53d8\uff0c\u7f51\u7edc\u5df2\u8fde\u63a5\uff0c\u542f\u52a8\u62cd\u7167\u6570\u636e\u4e0a\u4f20\u670d\u52a1"

    invoke-static {v0}, Lcom/fiberhome/upload/c/a;->a(Ljava/lang/String;)V

    new-instance v0, Landroid/content/Intent;

    const-string/jumbo v1, "android.intent.action.RUN"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-class v1, Lcom/fiberhome/upload/UpLoadService;

    invoke-virtual {v0, p1, v1}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    invoke-virtual {p1, v0}, Landroid/content/Context;->stopService(Landroid/content/Intent;)Z

    invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    :try_start_1
    const-string/jumbo v0, "\u7f51\u7edc\u72b6\u6001\u6539\u53d8\uff0c\u7f51\u7edc\u5df2\u8fde\u63a5\uff0c\u542f\u52a8H5\u6587\u4ef6\u4e0a\u4f20\u670d\u52a1"

    invoke-static {v0}, Lcom/fiberhome/upload/c/a;->b(Ljava/lang/String;)V

    new-instance v0, Landroid/content/Intent;

    const-string/jumbo v1, "android.intent.action.RUN"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-class v1, Lcom/fiberhome/upload/UpLoadH5FileService;

    invoke-virtual {v0, p1, v1}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    invoke-virtual {p1, v0}, Landroid/content/Context;->stopService(Landroid/content/Intent;)Z

    invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    :goto_1
    :try_start_2
    const-string/jumbo v0, "\u7f51\u7edc\u72b6\u6001\u6539\u53d8\uff0c\u7f51\u7edc\u5df2\u8fde\u63a5\uff0c\u542f\u52a8\u8868\u5355\u6570\u636e\u4e0a\u4f20\u670d\u52a1"

    invoke-static {v0}, Lcom/waiqin365/lightapp/visit/c/a;->a(Ljava/lang/String;)V

    new-instance v0, Landroid/content/Intent;

    const-string/jumbo v1, "android.intent.action.RUN"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-class v1, Lcom/waiqin365/lightapp/visit/SeniorVisitFormBgSubmitService;

    invoke-virtual {v0, p1, v1}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    invoke-virtual {p1, v0}, Landroid/content/Context;->stopService(Landroid/content/Intent;)Z

    invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2

    :cond_2
    :goto_2
    invoke-static {p1}, Lcom/fiberhome/gaea/client/d/e;->a(Landroid/content/Context;)Z

    move-result v0

    sget-boolean v1, Lcom/fiberhome/gaea/client/base/ExmobiApp;->j:Z

    if-eqz v1, :cond_4

    if-nez v0, :cond_3

    sput-boolean v3, Lcom/fiberhome/gaea/client/base/ExmobiApp;->j:Z

    new-instance v0, Lcom/waiqin365/lightwork/tracker/c/a/a;

    invoke-static {}, Lcom/fiberhome/gaea/client/base/ExmobiApp;->b()Lcom/fiberhome/gaea/client/base/ExmobiApp;

    move-result-object v1

    sget v2, Lcom/waiqin365/lightwork/tracker/c/a/a;->j:I

    new-instance v3, Ljava/util/Date;

    invoke-direct {v3}, Ljava/util/Date;-><init>()V

    invoke-direct {v0, v1, v2, v3}, Lcom/waiqin365/lightwork/tracker/c/a/a;-><init>(Landroid/content/Context;ILjava/util/Date;)V

    new-instance v1, Lcom/waiqin365/lightwork/tracker/c/b;

    invoke-direct {v1, v5, v0}, Lcom/waiqin365/lightwork/tracker/c/b;-><init>(Landroid/os/Handler;Lcom/waiqin365/lightwork/tracker/c/a/b;)V

    invoke-virtual {v1}, Lcom/waiqin365/lightwork/tracker/c/b;->start()V

    :cond_3
    :goto_3
    return-void

    :catch_0
    move-exception v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "\u4e0a\u4f20\u62cd\u7167\u6570\u636e\u5f02\u5e38="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/fiberhome/upload/c/a;->a(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0

    :catch_1
    move-exception v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "\u4e0a\u4f20H5\u6587\u4ef6\u6570\u636e\u5f02\u5e38="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/fiberhome/upload/c/a;->b(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1

    :catch_2
    move-exception v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "\u542f\u52a8\u8868\u5355\u4e0a\u4f20\u670d\u52a1\u5f02\u5e38="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/waiqin365/lightapp/visit/c/a;->a(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto/16 :goto_2

    :cond_4
    if-eqz v0, :cond_3

    sput-boolean v4, Lcom/fiberhome/gaea/client/base/ExmobiApp;->j:Z

    new-instance v0, Lcom/waiqin365/lightwork/tracker/c/a/a;

    invoke-static {}, Lcom/fiberhome/gaea/client/base/ExmobiApp;->b()Lcom/fiberhome/gaea/client/base/ExmobiApp;

    move-result-object v1

    sget v2, Lcom/waiqin365/lightwork/tracker/c/a/a;->k:I

    new-instance v3, Ljava/util/Date;

    invoke-direct {v3}, Ljava/util/Date;-><init>()V

    invoke-direct {v0, v1, v2, v3}, Lcom/waiqin365/lightwork/tracker/c/a/a;-><init>(Landroid/content/Context;ILjava/util/Date;)V

    new-instance v1, Lcom/waiqin365/lightwork/tracker/c/b;

    invoke-direct {v1, v5, v0}, Lcom/waiqin365/lightwork/tracker/c/b;-><init>(Landroid/os/Handler;Lcom/waiqin365/lightwork/tracker/c/a/b;)V

    invoke-virtual {v1}, Lcom/waiqin365/lightwork/tracker/c/b;->start()V

    goto :goto_3
.end method
